<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>

<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta charset="UTF-8">
    <meta name="description" content="清镇安监卫士">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">

    <title>绑定手机号</title>

    <style type="text/css">
        body, div, p, h1, h2, h3, h4, h5, h6, li, span, label, a {
            font-family: "Arial",
            "Microsoft YaHei", "微软雅黑",
            "SimHei", "黑体",
            "STHeiti", "华文黑体",
            "NSimSun", "新宋体",
            "SimSun", "宋体",
            "sans-serif";
        }
    </style>

    <link rel="stylesheet" href="<%=basePath%>js/lib/ace/assets/css/bootstrap.css">
    <link rel="stylesheet" href="<%=basePath%>js/lib/ace/components/font-awesome/css/font-awesome.css">
    <link rel="stylesheet" href="<%=basePath%>js/lib/jquery/jquery-toast/css/jquery.toast.css">
    <link rel="stylesheet" href="<%=basePath%>js/lib/uploadifive/uploadifive.css">
    <link rel="stylesheet" href="<%=basePath%>css/lib/iconfont/iconfont.css">
    <link rel="stylesheet" href="<%=basePath%>css/common/common.css">
</head>
<body>
<div class="container">
    <div class="row">
        <div class="col-md-12">
            <h1 class="m-0 p-0 p-t-5 p-b-10 c-red f-s-20 align-center">绑定手机号</h1>
        </div>

        <div class="col-md-12">
            <div class="alert alert-success">
                <div>
                    <span class="f-s-16">
                        <i class="iconfont icon-bell f-s-16"></i>温馨提示：
                    </span>
                </div>

                <div>
                    <span class="f-s-15">
                        请输入您登录微信的手机号，以便我们与您取得联系！
                    </span>
                </div>
            </div>
        </div>

        <div class="col-md-12">
            <form id="form" class="form-horizontal" role="form" method="post" enctype="multipart/form-data" action="<%=basePath%>weixin/bind/phone.html">
                <input name="openid" type="hidden" value="${resultVo.results[0]}">
                <input name="redirectUrl" type="hidden" value="${resultVo.results[1]}">

                <c:if test="${not empty resultVo.results[2]}">
                    <div class="form-group">
                        <label for="curr_phone" class="col-md-3 control-label f-s-16 c-tint-black">您当前绑定的手机号</label>

                        <div class="col-md-9">
                            <input id="curr_phone" type="text" class="form-control input-lg" value="${resultVo.results[2]}" placeholder="手机号" readonly="readonly">
                        </div>
                    </div>
                </c:if>

                <div class="form-group">
                    <c:choose>
                        <c:when test="${empty resultVo.results[2]}">
                            <label for="phone" class="col-md-3 control-label f-s-16 c-tint-black">手机号</label>

                            <div class="col-md-9">
                                <input id="phone" name="phone" type="text" class="form-control input-lg" placeholder="手机号">
                            </div>
                        </c:when>
                        <c:otherwise>
                            <label for="new_phone" class="col-md-3 control-label f-s-16 c-tint-black">新手机号</label>

                            <div class="col-md-9">
                                <input id="new_phone" name="phone" type="text" class="form-control input-lg" placeholder="新手机号">
                            </div>
                        </c:otherwise>
                    </c:choose>
                </div>

                <div class="form-group">
                    <div class="col-md-12">
                        <c:choose>
                            <c:when test="${empty resultVo.results[2]}">
                                <button name="submitBtn" class="btn btn-success btn-lg btn-block" type="button">
                                    <i class="iconfont icon-plus f-s-16"></i>绑定
                                </button>
                            </c:when>
                            <c:otherwise>
                                <button name="submitBtn" class="btn btn-success btn-lg btn-block" type="button">
                                    <i class="iconfont icon-plus f-s-16"></i>重新绑定
                                </button>
                            </c:otherwise>
                        </c:choose>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>

<script type="text/javascript">
    // 全局服务器路径
    var globalBasePath = "<%=basePath%>";
</script>

<script type="text/javascript" src="<%=basePath%>js/lib/ace/components/jquery/dist/jquery.js"></script>
<script type="text/javascript" src="<%=basePath%>js/lib/ace/components/bootstrap/dist/js/bootstrap.js"></script>
<script type="text/javascript" src="<%=basePath%>js/lib/jquery/jquery-toast/js/jquery.toast.js"></script>

<script type="text/javascript" src="<%=basePath%>js/common/utils.js"></script>
<script type="text/javascript" src="<%=basePath%>js/common/jquery.utils.js"></script>
<script type="text/javascript" src="<%=basePath%>js/jsp/weixin/bind-phone.js"></script>
</body>
</html>